package org.spbsu.apco.server.broker;

import org.spbsu.apco.server.taskset.BaseTaskSet;

import java.util.Collection;

/**
 * User: solozobov
 * Date: 17.11.12
 */

/**
 * Broker manages bags of tasks {@link BaseTaskSet}.
 */
public interface Broker {
    /**
     * Add taskset for execution
     *
     * @param taskSet taskset to be queued
     */
    void addTaskSet(BaseTaskSet taskSet);

    /**
     * Check if taskset execution is finished.
     *
     * @param taskSet taskset to check finish status
     * @return either taskset is finished or not
     */
    boolean isFinished(BaseTaskSet taskSet);

    /**
     * Get collection of results (in an implementation specific format) for a specified taskset.
     *
     * @param taskSet which results must be returned
     * @return results of taskset execution
     */
    Collection<Object> getResults(BaseTaskSet taskSet);
}
